package com.juzipi.inter.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.juzipi.inter.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;


@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "user")
public class User extends BaseEntity {

    
    @JsonSerialize(using= ToStringSerializer.class)
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    //这里注册的时候随机生成昵称
    @TableField(fill = FieldFill.INSERT)
    private String nickname;
    //用户名，账号
    private String username;
    //密码
    private String password;
    //性别
    private String gender;
    //邮箱
    private String email;
    //电话号码
    private String phoneNumber;
    //最后登录时间
    private Date lastLoginTime;

    private String code;

    //用户状态 是否未禁用
    @TableField(fill = FieldFill.INSERT)
    private Boolean nonDisable;

    //用户状态 是否锁定
    @TableField(fill = FieldFill.INSERT)
    private Boolean nonLocked;

    //用户对应的角色的id
    @TableField(fill = FieldFill.INSERT)
    private Long roleId;

    //更新者
//    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    //创建者
//    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    //乐观锁
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

}
